﻿#region License

// Copyright (c) 2013, ClearCanvas Inc.
// All rights reserved.
// http://www.clearcanvas.ca
//
// This file is part of the ClearCanvas RIS/PACS open source project.
//
// The ClearCanvas RIS/PACS open source project is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// The ClearCanvas RIS/PACS open source project is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// the ClearCanvas RIS/PACS open source project.  If not, see
// <http://www.gnu.org/licenses/>.

#endregion

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.269
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// 
// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.269.
// 
#pragma warning disable 1591

namespace ClearCanvas.ImageViewer.DesktopServices.Automation.TestClient.DicomExplorerAutomationAsp {
    using System;
    using System.Web.Services;
    using System.Diagnostics;
    using System.Web.Services.Protocols;
    using System.ComponentModel;
    using System.Xml.Serialization;
    
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="DicomExplorerAutomation", Namespace="http://www.clearcanvas.ca/imageViewer/automation")]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchStudiesRequest))]
    public partial class DicomExplorerAutomation : System.Web.Services.Protocols.SoapHttpClientProtocol {
        
        private System.Threading.SendOrPostCallback SearchLocalStudiesOperationCompleted;
        
        private System.Threading.SendOrPostCallback SearchRemoteStudiesOperationCompleted;
        
        private bool useDefaultCredentialsSetExplicitly;
        
        /// <remarks/>
        public DicomExplorerAutomation() {
            this.Url = "http://localhost:51124/ClearCanvas/ImageViewer/DicomExplorer/Automation";
            if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
                this.UseDefaultCredentials = true;
                this.useDefaultCredentialsSetExplicitly = false;
            }
            else {
                this.useDefaultCredentialsSetExplicitly = true;
            }
        }
        
        public new string Url {
            get {
                return base.Url;
            }
            set {
                if ((((this.IsLocalFileSystemWebService(base.Url) == true) 
                            && (this.useDefaultCredentialsSetExplicitly == false)) 
                            && (this.IsLocalFileSystemWebService(value) == false))) {
                    base.UseDefaultCredentials = false;
                }
                base.Url = value;
            }
        }
        
        public new bool UseDefaultCredentials {
            get {
                return base.UseDefaultCredentials;
            }
            set {
                base.UseDefaultCredentials = value;
                this.useDefaultCredentialsSetExplicitly = true;
            }
        }
        
        /// <remarks/>
        public event SearchLocalStudiesCompletedEventHandler SearchLocalStudiesCompleted;
        
        /// <remarks/>
        public event SearchRemoteStudiesCompletedEventHandler SearchRemoteStudiesCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.clearcanvas.ca/imageViewer/automation/IDicomExplorerAutomation/SearchL" +
            "ocalStudies", RequestNamespace="http://www.clearcanvas.ca/imageViewer/automation", ResponseNamespace="http://www.clearcanvas.ca/imageViewer/automation", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
        public SearchLocalStudiesResult SearchLocalStudies([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] SearchLocalStudiesRequest request) {
            object[] results = this.Invoke("SearchLocalStudies", new object[] {
                        request});
            return ((SearchLocalStudiesResult)(results[0]));
        }
        
        /// <remarks/>
        public void SearchLocalStudiesAsync(SearchLocalStudiesRequest request) {
            this.SearchLocalStudiesAsync(request, null);
        }
        
        /// <remarks/>
        public void SearchLocalStudiesAsync(SearchLocalStudiesRequest request, object userState) {
            if ((this.SearchLocalStudiesOperationCompleted == null)) {
                this.SearchLocalStudiesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSearchLocalStudiesOperationCompleted);
            }
            this.InvokeAsync("SearchLocalStudies", new object[] {
                        request}, this.SearchLocalStudiesOperationCompleted, userState);
        }
        
        private void OnSearchLocalStudiesOperationCompleted(object arg) {
            if ((this.SearchLocalStudiesCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.SearchLocalStudiesCompleted(this, new SearchLocalStudiesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.clearcanvas.ca/imageViewer/automation/IDicomExplorerAutomation/SearchR" +
            "emoteStudies", RequestNamespace="http://www.clearcanvas.ca/imageViewer/automation", ResponseNamespace="http://www.clearcanvas.ca/imageViewer/automation", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
        public SearchRemoteStudiesResult SearchRemoteStudies([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] SearchRemoteStudiesRequest request) {
            object[] results = this.Invoke("SearchRemoteStudies", new object[] {
                        request});
            return ((SearchRemoteStudiesResult)(results[0]));
        }
        
        /// <remarks/>
        public void SearchRemoteStudiesAsync(SearchRemoteStudiesRequest request) {
            this.SearchRemoteStudiesAsync(request, null);
        }
        
        /// <remarks/>
        public void SearchRemoteStudiesAsync(SearchRemoteStudiesRequest request, object userState) {
            if ((this.SearchRemoteStudiesOperationCompleted == null)) {
                this.SearchRemoteStudiesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSearchRemoteStudiesOperationCompleted);
            }
            this.InvokeAsync("SearchRemoteStudies", new object[] {
                        request}, this.SearchRemoteStudiesOperationCompleted, userState);
        }
        
        private void OnSearchRemoteStudiesOperationCompleted(object arg) {
            if ((this.SearchRemoteStudiesCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.SearchRemoteStudiesCompleted(this, new SearchRemoteStudiesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        public new void CancelAsync(object userState) {
            base.CancelAsync(userState);
        }
        
        private bool IsLocalFileSystemWebService(string url) {
            if (((url == null) 
                        || (url == string.Empty))) {
                return false;
            }
            System.Uri wsUri = new System.Uri(url);
            if (((wsUri.Port >= 1024) 
                        && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
                return true;
            }
            return false;
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.233")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.clearcanvas.ca/imageViewer/automation")]
    public partial class SearchLocalStudiesRequest : SearchStudiesRequest {
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchRemoteStudiesRequest))]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchLocalStudiesRequest))]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.233")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.clearcanvas.ca/imageViewer/automation")]
    public partial class SearchStudiesRequest {
        
        private DicomExplorerSearchCriteria searchCriteriaField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
        public DicomExplorerSearchCriteria SearchCriteria {
            get {
                return this.searchCriteriaField;
            }
            set {
                this.searchCriteriaField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.233")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.clearcanvas.ca/imageViewer/automation")]
    public partial class DicomExplorerSearchCriteria {
        
        private string accessionNumberField;
        
        private string[] modalitiesField;
        
        private string patientIdField;
        
        private string patientsNameField;
        
        private string referringPhysiciansNameField;
        
        private System.Nullable<System.DateTime> studyDateFromField;
        
        private System.Nullable<System.DateTime> studyDateToField;
        
        private string studyDescriptionField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
        public string AccessionNumber {
            get {
                return this.accessionNumberField;
            }
            set {
                this.accessionNumberField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlArrayAttribute(IsNullable=true)]
        [System.Xml.Serialization.XmlArrayItemAttribute(Namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays")]
        public string[] Modalities {
            get {
                return this.modalitiesField;
            }
            set {
                this.modalitiesField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
        public string PatientId {
            get {
                return this.patientIdField;
            }
            set {
                this.patientIdField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
        public string PatientsName {
            get {
                return this.patientsNameField;
            }
            set {
                this.patientsNameField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
        public string ReferringPhysiciansName {
            get {
                return this.referringPhysiciansNameField;
            }
            set {
                this.referringPhysiciansNameField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
        public System.Nullable<System.DateTime> StudyDateFrom {
            get {
                return this.studyDateFromField;
            }
            set {
                this.studyDateFromField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
        public System.Nullable<System.DateTime> StudyDateTo {
            get {
                return this.studyDateToField;
            }
            set {
                this.studyDateToField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
        public string StudyDescription {
            get {
                return this.studyDescriptionField;
            }
            set {
                this.studyDescriptionField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.233")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.clearcanvas.ca/imageViewer/automation")]
    public partial class SearchRemoteStudiesResult {
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.233")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.clearcanvas.ca/imageViewer/automation")]
    public partial class SearchLocalStudiesResult {
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.233")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.clearcanvas.ca/imageViewer/automation")]
    public partial class SearchRemoteStudiesRequest : SearchStudiesRequest {
        
        private string aETitleField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
        public string AETitle {
            get {
                return this.aETitleField;
            }
            set {
                this.aETitleField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    public delegate void SearchLocalStudiesCompletedEventHandler(object sender, SearchLocalStudiesCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class SearchLocalStudiesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal SearchLocalStudiesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public SearchLocalStudiesResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((SearchLocalStudiesResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    public delegate void SearchRemoteStudiesCompletedEventHandler(object sender, SearchRemoteStudiesCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class SearchRemoteStudiesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal SearchRemoteStudiesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public SearchRemoteStudiesResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((SearchRemoteStudiesResult)(this.results[0]));
            }
        }
    }
}

#pragma warning restore 1591